package com.kvn.cucumbertestng;

import cucumber.api.java.en.And;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import org.testng.Assert;

/**
 * @author wzy on 2017/8/8.
 */
public class DemoTestngStepdefs {
    private String input1;
    private String input2;

    @Given("^用户输入\"([^\"]*)\"$")
    public void 用户输入(String arg0) throws Throwable {
        input1 = arg0;
    }

    @And("^再次输入\"([^\"]*)\"$")
    public void 再次输入(String arg0) throws Throwable {
        input2 = arg0;
    }

    @Then("^结果应该是\"([^\"]*)\"$")
    public void 结果应该是(String arg0) throws Throwable {
        System.out.println("结果应该是 ==> [" + arg0 + "]");
        Assert.assertEquals(Boolean.valueOf(arg0).booleanValue(), input1.equals(input2));
    }
}
